class UsersController < ApplicationController

  # render new.rhtml
  def new
  end

  def create
    @user = User.new(params[:user])
    @user.save!
    self.current_user = @user
    redirect_back_or_default('/')
    flash[:notice] = "Thanks for signing up!"
  rescue ActiveRecord::RecordInvalid
    render :action => 'new'
  end

  def index
    @users = User.find(:all, :order => 'login')

    respond_to do |format|
      format.html
      format.xml  { render :xml => @users.to_xml(:only => [:id, :login, :email, :created_at]) }
    end
  end

  def show
     @user = User.find(params[:id])
  end

end
